<?php
namespace app\index\controller;

use app\index\service\CategoryService;
use app\index\service\CompanyService;
use app\index\service\ConsultService;
use app\index\service\NewsService;
use app\index\service\UrlService;
use think\Controller;
use think\Request;
class Index extends BaseController
{

    public function index()
    {


//        $this->assign("id",$id);
        $category_list = CategoryService::getSupCategoryList();
        $url_list = UrlService::getIndexThirdUrlList();
        $rec_company_list = CompanyService::getIndexCompanyList();
        $rec_consult_list = ConsultService::getIndexRecList();
        $total_consult_num = ConsultService::getAllConsultNum();
        $rec_news_list = NewsService::getIndexRecNewsList();
        $sup_cate_one = CategoryService::getSupCategoryById(1);
        $sup_cate_two = CategoryService::getSupCategoryById(2);
        $this->assign("category_list",$category_list);

        $this->assign("idIndex","0");
        $this->assign("thirdurl_list",$url_list);
        $this->assign("rec_company_list",$rec_company_list);
        $this->assign("rec_consult_list",$rec_consult_list);
        $this->assign("rec_news_list",$rec_news_list);
        $this->assign("total_consult_num",$total_consult_num);
        $this->assign("sup_cate_one",$sup_cate_one);
        $this->assign("sup_cate_two",$sup_cate_two);
        $this->fetch("public/footer");
        $this->fetch("public/header");

        return $this->fetch("index",["idIndex"=>"0","category_list"=>$category_list]);
        //return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) 2018新年快乐</h1><p> ThinkPHP V5.1<br/><span style="font-size:30px">12载初心不改（2006-2018） - 你值得信赖的PHP框架</span></p></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=64890268" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="eab4b9f840753f8e7"></think>';
    }

    public function hello($name = 'ThinkPHP5')
    {
        return 'hello,' . $name;
    }
}
